home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / amigae.0294feb.archive / 000047_donews!crash!h…m.ac.uk!dmh1002_Sat, 12 Feb 94 01:46:32 PST.msg < prev    next >
Internet Message Format  |  1994-05-26  |  3KB

  1. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  2.       id <1t9h@bkhouse.cts.com>; Sat, 12 Feb 94 01:46:32 PST
  3. Received: from crash by donews.cts.com with uucp
  4.     (Smail3.1.28.1 #18) id m0pVGiF-0001THC; Sat, 12 Feb 94 04:32 EST
  5. Received: from ppsw2.cam.ac.uk by crash.cts.com with smtp
  6.     (Smail3.1.28.1 #18) id m0pVGhW-0000CxC; Sat, 12 Feb 94 01:31 PST
  7. Received: from black.csi.cam.ac.uk by ppsw2.cam.ac.uk 
  8.           with SMTP-CAM (PP-6.0) as ppsw.cam.ac.uk 
  9.           id <07012-0@ppsw2.cam.ac.uk>; Sat, 12 Feb 1994 09:31:41 +0000
  10. Received: from hermes.cam.ac.uk by black.csi.cam.ac.uk 
  11.           id <22704-0@black.csi.cam.ac.uk>; Sat, 12 Feb 1994 09:31:39 +0000
  12. Date: Sat, 12 Feb 1994 09:32:44 +0000 (GMT)
  13. In-Reply-To: <m0pUcJV-0000AFC@crash.cts.com>
  14. Message-ID: <Pine.3.89.9402120957.A12049-0100000@blue.csi.cam.ac.uk>
  15. MIME-Version: 1.0
  16. Content-Type: TEXT/PLAIN; charset=US-ASCII
  17. Sender: dmh1002@hermes.cam.ac.uk
  18. From: Dave Higginson <dmh1002@hermes.cam.ac.uk>
  19. To: The AmigaE Mailing List <AmigaE@bkhouse.cts.com>
  20. Subject: Re: Thanx
  21.  
  22.  
  23. On Thu, 10 Feb 1994, Olivier Anh wrote:
  24.  
  25. > Why is l.head:=l+4, for what is this 4 ?
  26. > What is the meaning of .tailpred. I know the others items, but this not one.
  27.  
  28. 4 is the size of a pointer. So l+4 is actually a pointer to the Tail 
  29. field of the List.
  30.  
  31. Memory     List         Head Node      Tail Node
  32. -----------------------------------------
  33.  l         Head         Head.Succ          -
  34.  l+4       Tail         Head.Pred      Tail.Succ   <- always NIL
  35.  l+8       TailPred         -          Tail.Pred
  36.  
  37. This is how you should think of a list. Even though there are only 3 
  38. pointers, there are actually 4, but because 2 of them are always NIL 
  39. (Head.Pred and Tail.Succ), you can put them in the same memory to save 
  40. space. So l is a pointer to the Head Node and l+4 is a pointer to the 
  41. tail node. The Head node's successor is the tail node when the list is 
  42. empty, hence List.Head:=l+4
  43.  
  44. > /*-- This is where the string gadget buffer is hidden. --*/
  45. >   stringInfo:=stringGadget.specialinfo
  46. >   stringGadgetValue:=stringInfo.buffer
  47. > /*-------------------------------------------------------*/
  48. > What do you measn with 'hidden' ?
  49.  
  50. It's not really hidden, just that C= buried it rather deep in the gadget 
  51. structure :-)
  52.  
  53. > Must we always detach the list from the listview gadget before modifying it ?
  54.  
  55. Yes. Otherwise Intuition might try to refresh the gadget using the list 
  56. while you were messing about with its pointers. That's the disadvantage 
  57. of a pre-emptive multitasking system :-)
  58.  
  59. Hope this helps,
  60.  
  61. Dave
  62.  
  63. P.S. If you have the RKM Libraries there is a whole chapter on Lists 
  64. which probably explains them better than I can.
  65.  
  66. +--
  67.   // David Higginson, dmh1002@hermes.cam.ac.uk
  68. \X/  Churchill College, Cambridge, CB3 0DS, UK